package com.wx.infrastructure.exception;

import com.wx.infrastructure.domain.ErrorCode;

/**
 * wx_back_end
 *
 * @Auther: cheng.tang
 * @Date: 2023/3/1 7:43 AM
 * @Description:
 */
public class DefaultBizException extends RuntimeException {
    private ErrorCode errorCode;

    public DefaultBizException(ErrorCode errorCode) {
        this.errorCode = errorCode;
    }

    public DefaultBizException(ErrorCode bizError, Throwable cause) {
        super(cause);
        this.errorCode = bizError;
    }

    public ErrorCode getErrorCode() {
        return errorCode;
    }

    @Override
    public String getMessage() {
        return this.errorCode.getMsg();
    }
}
